

#ifndef __celement__
#define __celement__

#include <vector>

#include "cmodel.h"
#include "cevent.h"
class CModel;
class CEvent;

class CElement {

protected:
	static long max_id_now;


	char name[256];
	int element_type;
	long element_id;
	std::vector<CElement*> PreviousElements;
	std::vector<CElement*> NextElements;
	CModel* theModel;
public:

	static const int TYPE_MACHINE;
	static const int TYPE_BUFFER;
	
	virtual void Respond(CEvent* evt);
	CElement();
	~CElement();
	
	void setName(char* str);
	void setType(int tp);
	void AddNextElement(long the_id);
	void AddPreviousElement(long the_id);
	void AddNextElement(CElement* elm);
	void AddPreviousElement(CElement* elm);
	void bindModel(CModel* p_model);
	long getID();
	int getType();

};
#endif // __celement__

